package com.briup.jdbc.handler.invoke;

import java.sql.Connection;

import com.briup.jdbc.conn.JDBCPool;

public abstract class AbstractInvoke {

	Connection conn;
	boolean autoCommit;

	public AbstractInvoke(Connection conn, boolean autoCommit) throws Exception {
		super();
//		System.out.println(conn);
//		System.out.println(autoCommit);
		if (conn == null && !autoCommit) {
			throw new Exception("you have not selected auto-commit , and connection is null!");
		}
		if (conn == null) {
			this.conn = JDBCPool.getConn();
		} else {
			this.conn = conn;
		}
		this.autoCommit = autoCommit;
	}

}
